package day08.synch02._01;

/**
 * <>
 * <详细描述>
 *
 * @Author WANG.SONG.
 * @Date 2019/3/5 0005 22:35
 * @see
 */
public class Task {
    private String getData1;

    private String getData2;

    synchronized public  void doLongTime(){
        System.out.println("begin task");
        try {
            Thread.sleep(3000);
            getData1 = "长时间处理任务后从远程返回data1,threadName = "+Thread.currentThread().getName();
            getData2 = "长时间处理任务后从远程返回data2,threadName = "+Thread.currentThread().getName();
            System.out.println(getData1);
            System.out.println(getData2);
            System.out.println("end task");
        } catch (InterruptedException e) {
            e.printStackTrace();
        }
    }
}
